<html>
<head>
    <title>球球</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>
        body {
            background-image: url("../第八周/WOW.jpg");
        }

        h2 {
            color: #E0ECFF;
        }
    </style>
</head>
</body>
<?php
//穷举法
for ($x = 1; $x < 25; $x++) {
    for ($y = 1; $y < 31; $y++) {
        for ($z = 1; $z < 28; $z++) {
            if ($x + $y == 25 && $y + $z == 31 && $x + $z == 28) {
                echo "<h2>红球个数:" . $x . "</h2> <br>";
                echo "<h2>白球个数:" . $y . "  </h2><br>";
                echo "<h2>黑球个数:" . $z . "  </h2><br>";
            }
        }
    }
}
echo '<hr>';
//数据关系
$b = 0;//白球
$c = 0;//黑球
for ($a = 1; $a <= 25; $a++) {
    $b = 25 - $a;
    $c = 28 - $a;
    if ($b + $c == 31) {
        echo "<h2>红球个数:" . $a . "</h2> <br>";
        echo "<h2>白球个数:" . $b . " </h2> <br>";
        echo "<h2>黑球个数:" . $c . " </h2> <br>";
    }
}
?>
</body>
</html>
